<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title></title>
</head>

<body>
<script type="text/javascript">
let obj1 = {
    a:1,
    b:2
}
let obj2 = {
    ...obj1,
    c:3
}
console.log(obj2) //{a: 1, b: 2, c: 3}
obj1.a = 6
console.log(obj1,obj2) //{a: 6, b: 2} {a: 1, b: 2, c: 3} 证明是深拷贝
</script>
</body>

</html>